// components/catalog-row/catalog-row.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        item: {
            type: Array,
            value: []
        },
        index: {
            type: Number,
            value: 0
        }
    },

    /**
     * 组件的初始数据
     */
    data: {
        isShow: true,
        icon: '/image/down@2x.png'
    },
    /**
     * 组件的方法列表
     */
    methods: {
        toggleChildren: function (e) {
            if (this.data.isShow) {
                this.setData({
                    isShow: false,
                    icon: "/image/up@2x.png"
                })
            } else {
                this.setData({
                    isShow: true,
                    icon: "/image/down@2x.png"
                })
            };
            var Detail = { current: this.data.index };
            this.triggerEvent("closeOther", Detail);
        },
        closeChildren: function (index) {
            if (this.data.index == index) return;
            this.setData({
                isShow: true,
                icon: "/image/down@2x.png"
            })
        }
    }
})
